package com.tl.boot.entity.login.form;

import com.tl.boot.common.enums.ResultEnum;
import com.tl.boot.common.exception.BaseException;
import com.tl.boot.entity.demo.form.Base.BaseForm;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * com.tl.boot.entity.login -- LoginForm
 * Description:
 * Created by joshua_liu <a href="mailto:joshualwork@163.com"></a>
 * On 2019/9/10 18:12
 */
public class LoginForm  extends BaseForm{
    @ApiModelProperty( value = "用户名", name = "username", example = "zhangsan@123" )
    private String username;
    @ApiModelProperty( value = "密码", name = "password", example = "zhangsan@123！" )
    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public void checkParam() {
        if (StringUtils.isBlank(username) || StringUtils.isBlank(password)) {
            throw new BaseException(ResultEnum.REQUEST_PARAM_ILLEGAL);
        }
    }
}
